<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Register_model extends CI_Model {

	/*create - post
	read - get
	update - post 
	delete - get*/
	function validate_new_user($userdata){
		$this->db->where('username', $userdata['username']);
		$this->db->where('email', $userdata['email']);
		$query = $this->db->get('users', $userdata);

		if ($query->num_rows == 0) {
			$this->insert($userdata);
			return true;
		}else{
			return false;
		}
	}

	function insert($userdata){
		$this->db->insert('users', $userdata);
	}

}

/* End of file register_model.php */
/* Location: ./application/models/register_model.php */